package com.kuang.utils;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class BaseUtils {

    public static Object encryptionMD5(String credentials) {
        return BaseUtils.encryptionMD5(credentials, "default");
    }

    public static Object encryptionMD5(String credentials, String str) {

        String hashAlgorithmName = "MD5";
        int hashInterations = 1024;
        ByteSource credentialsSalt = ByteSource.Util.bytes(str);
        return new SimpleHash(hashAlgorithmName, credentials, credentialsSalt, hashInterations);
    }
}
